<?php
$web_root_path = substr($_SERVER['SCRIPT_FILENAME'] ,0 , -strlen($_SERVER['SCRIPT_NAME']));
require_once($web_root_path . "/lib/MySubmitUtil.class.php");

class MyReplyUtil extends MysubmitUtil{
    protected $comment_id;
    function getDataFromFrom(){
        $this->content = $_POST["content"];
        $this->nickname = $_POST["nickname"];
        $this->comment_id = $_POST["comment_id"];
    }
    function insertDataToDb(){
        //エラーがなかったらデータベースにデータを挿入
        if ($this->error_arr["error_yn"] == "n") {
            //mysqlに接続する
            DbWrapper::dbChoice();

            //クエリを送信する
            $sql = "INSERT INTO reply (nickname, content, comment_id, created_at)values ('" .
            $this->nickname ."','".
            $this->content ."','".
            $this->comment_id . "','" .
            date("Y-m-d H:i:s")."')";

            $result = mysql_query($sql);
        }
    }
}
